<%@ page contentType="text/html;charset=utf-8" %>
<%@ page import="java.util.*" %>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
function deleteRow(obj) {
		$(obj).parent().parent().next().remove();
		$(obj).parent().parent().remove();
	}
	
	
function save() {
		document.getElementById("cfgform").action = "gameManage.do?pm=updateServerCfg";
		//TODO:需要验证下参数
		document.getElementById("cfgform").submit();
	}
	
/****************图片上传组件**************/
	function openUpload(obj){
	 	 var windowStatus = "dialogWidth:400px; dialogHeight:360px; center:yes; resizable:no; scroll:no; status:no; help:no; ";
	 	 var url = "common.do?pm=gotoUpload";
	 	 var returnValue = window.showModalDialog(url,"",windowStatus);
	 	 if(returnValue!=undefined){
	 		 obj.value=returnValue;
	 	 }
}
/*****************图片上传组件END****************/
</script>
<form  method="post" name="cfgform" id="cfgform">
<style type="text/css">
input {
	border: 1px #ccc solid;
}
</style>
<%
List<Map> serverCfgList=(List<Map>)request.getAttribute("serverCfgList");
%>
<div class="content-box-header">
					<h3>服务器配置</h3>
					<div class="clear"></div>
				</div> 
                <div class="content-box-content">
               	  	<table id="homePagePicCfgs">
               	  		<% 
               	  			int _tmp=0;
               	  			int cfgType;
               	  			String cfgTypeString;
               	  			if(serverCfgList!=null && serverCfgList.size()>0){
               	  			for(int t=0;t<serverCfgList.size();t++){
               	  				cfgType=Integer.valueOf((String)serverCfgList.get(t).get("clazz"));
               	  				switch(cfgType){
               	  					case 1:cfgTypeString="内部处理";break;
               	  					case 2:cfgTypeString="淘宝客相关";break;
               	  					case 3:cfgTypeString="域名与搜索引擎及其他服务器信息";break;
               	  					default : cfgTypeString="未知参数";break;
               	  				}
               	  				if(_tmp!=cfgType){
               	  				_tmp=cfgType;
               	  				%>
               	  				<tr><td colspan='5' style='color:green; font-size: 16px'>><%=cfgTypeString %></td></tr><tr><td colspan='5'>&nbsp;</td></tr>
               	  				<% 
               	  				}
               	  		%>
             			<tr>
             				<td><input type='text' name='key' value='<%=serverCfgList.get(t).get("key") %>' size='20' maxlength="200"/>&nbsp;</td>
             				<td>&nbsp;<input type='text' name='value' value='<%=serverCfgList.get(t).get("value") %>' size='40' maxlength="200"></input></td>
             				<td>开启&nbsp;<input  type='text' name='enable' value='<%=serverCfgList.get(t).get("enable") %>' size='4' maxlength='4' /></td>
             				<td>MEMO&nbsp;<input  type='text' name='memo' value='<%=serverCfgList.get(t).get("memo") %>' size='50' maxlength='400' /></td>
             			</tr><tr><td colspan='5'>&nbsp;</td></tr>
               	  		<%
               	  		}}
               	  		%>
                  	</table>
                </div>
                <div style="text-align:right;margin-bottom: 4px"><input  style="border:solid 1px #000;width:160px;cursor:pointer;height:40px" type="button" onmousemove=(this.style.background='#57a000') onmouseout=(this.style.background='#FFF')   value="保存配置" onclick="save()" type="button"/></div>
</form>            